package com.langhua.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.langhua.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderDetailMapper extends BaseMapper<OrderDetail> {

    /**
     * 统计订单详情表的每个菜品的信息（数量，总价）
     * @return
     */
    @Select("select name,sum(number) as number,sum(price) as price from order_detail group by name")
    public List<OrderDetail> getDIshTotal();
}
